//
//  SYS_OrderDetailAddressView.m
//  System_App
//
//  Created by 吴健 on 2017/11/30.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_OrderDetailAddressView.h"

@implementation SYS_OrderDetailAddressView

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        
        self.imv_location = [[UIImageView alloc] initWithFrame:CGRectMake(10, 30, 15, 24)];
        self.imv_location.image = WJIMAGE(@"home_orderAddress");
        [self addSubview:self.imv_location];
        
        self.lb_name = [[UILabel alloc] initWithFrame:CGRectMake(40, 15, 150, 20)];
        self.lb_name.textColor = SubTitleColor;
        self.lb_name.text = @"收货人：张柠檬";
        self.lb_name.font = DSFONT_DETAIL;
        [self addSubview:self.lb_name];
        
        self.lb_phone = [[UILabel alloc] initWithFrame:CGRectMake(SCREENWIDTH-110, 15, 100, 20)];
        self.lb_phone.textColor = SubTitleColor;
        self.lb_phone.font = DSFONT_DETAIL;
        self.lb_phone.textAlignment = NSTextAlignmentRight;
        self.lb_phone.text = @"13783920989";
        [self addSubview:self.lb_phone];
        
        self.lb_address = [[UILabel alloc] initWithFrame:CGRectMake(40, 40, SCREENWIDTH-50, 40)];
        self.lb_address.textColor = SubTitleColor;
        self.lb_address.numberOfLines = 0;
        self.lb_address.text = @"安徽省合肥市西湖国际中心607安徽省合肥市西湖国际中心607";
        self.lb_address.font = DSFONT_DETAIL;
        [self addSubview:self.lb_address];
        
    }
    return self;
}

- (void)setIsShowNote:(BOOL)isShowNote{
    _isShowNote = isShowNote;
    if (_isShowNote) {
        UIView *v_line = [[UIView alloc] initWithFrame:CGRectMake(0, 80, SCREENWIDTH, 1)];
        v_line.backgroundColor = DSCOLOR_GRAY_BACKGROUND;
        [self addSubview:v_line];
        
        _note = [[UILabel alloc] initWithFrame:CGRectMake(10, 90, SCREENWIDTH - 20, 20)];
        _note.textColor = SubTitleColor;
        _note.numberOfLines = 0;
        _note.text = @"买家备注:";
        _note.font = DSFONT_DETAIL;
        [self addSubview:_note];
        
        [self setupAutoHeightWithBottomView:_note bottomMargin:10];
    }else{
        [self setupAutoHeightWithBottomView:self.lb_address bottomMargin:10];
    }
}


@end
